<?php require_once("./inc/head.php")?>

<?php require_once("./inc/header.php")?>


    <!-- section container -->
    <section class="section">
    
        <div class="container">
            <!-- url form -->
            <form action="result" method="POST" class="d-flex">
            <div class="url-form">
                    <input type="url" name="url" placeholder="Youtube url" class="form-control m-1 url-inp" autofocus required>
                    <button class="btn m-1 download-btn">解析</button>
                </div>
            </form>

            <!-- About YGC -->
            <div class="about-cont">
                <div class="img-cont" data-aos="zoom-in">
                    <img src="./assets/img/section/phn.png" alt="" class="img-fluid">
                </div>
                <div class="body" data-aos="fade-left">
                    <h1>About</h1>
                    <br>
                    <p>
                        是一款可让您使用内置的在线转换器将 YouTube 视频转换为 MP3 或其他格式。您还可以一键下载视频中的任何音轨。
                    </p>
                    <p>
                        帮助您下载 YouTube 视频并将其保存为 MP3（64kbps、128kbps、192kbps、320kbps）、MP4、WEBM、MKV 格式。我们使用先进的技术来摆脱 YouTube 蹩脚的转换限制（如分辨率限制）并为您提供高质量的文件。YGC Converter 让生活更轻松，这就是我们的工具在世界上如此受欢迎的原因。
                    </p>
                </div>
            </div>

            <!-- How to use section -->
            <div class="howto">
                <h1 data-aos="fade-up">如何使用</h1>
                <div class="boxes">
                    <div class="box" data-aos="zoom-in">
                        <span class="icon">
                            <ion-icon name="link-outline"></ion-icon>
                        </span>
                        <br>
                        <h2>输入视频网址</h2>
                    </div>
                    <div class="box" data-aos="zoom-in-up">
                        <span class="icon">
                            <ion-icon name="logo-youtube"></ion-icon>
                        </span>
                        <br>
                        <h2>选择MP4&MP3格式/h2>
                    </div>
                    <div class="box" data-aos="zoom-in-left">
                        <span class="icon">
                            <ion-icon name="cloud-download-outline"></ion-icon>
                        </span>
                        <br>
                        <h2>下载视频</h2>
                    </div>
                </div>
            </div>
            <br>
            <br>
        </div>
        <footer class="footer">
            <div class="btm-footer">
                <p>Copyright 2021 &copy; Youtube视频解析下载. All right reserved</p>
            </div>
        </footer>
    </section>
    <script>
        let downloadbtn = document.querySelector(".download-btn")

        downloadbtn.onclick = (e)=>{
            let inp = document.querySelector(".url-inp");
            if(inp.value !== ""){
                downloadbtn.innerHTML = `<span class="spinner-border text-dark"></span>`
            }
        }
    </script>
    <?php if(isset($_GET['err'])){?>
        <script>
            alert("<?php echo htmlspecialchars($_GET['err']); ?>")
            window.location = "index.php"
        </script>
    <?php }?>

<?php require_once("./inc/footer.php")?>